﻿@model BuyThePeople.Models.GoodsList

@{
    ViewBag.Title = "List";
}

<div class="main_container">
	<div class="main_content_list">
        <div>
			<hr style="width:100%;border:1px dashed #ffeac7"/>
			<span style="font-size:17pt;margin-left:30px;margin-right:460px;" >
                @if(ViewBag.sort == "order")
                {
                    @:인기 공동구매
                }
                else if (ViewBag.sort == "close")
                {
                    @:마감임박 공동구매
                }
                else
                {
                    @:최근등록 공동구매
                }
			</span>				
			<a href="/Goods/List/1?sort=new" style="@(ViewBag.sort == "new" ? "font-weight:bold" : "")">최근등록순</a> | 
			<a href="/Goods/List/1?sort=order" style="@(ViewBag.sort == "order" ? "font-weight:bold" : "")">참여자순</a> | 
			<a href="/Goods/List/1?sort=close" style="@(ViewBag.sort == "close" ? "font-weight:bold" : "")">마감임박순</a>
		</div>
		<div class="row-fluid no-space">
            <ul class="thumbnails">
                @foreach (var item in Model.goods)
                {
              <li class="span3">
                <div class="thumbnail" data-url="/Goods/Detail/@item.GoodsSeq">
                  <img src="@item.Image" alt="상품이미지" />
                  <div class="caption caption_modelname">
                    <span>@Html.DisplayFor(modelItem => item.Title)</span>
                  </div>
				  <div class="caption captionprice" >
                    <span>@string.Format("{0:N0}", item.LowPrice)원</span>
                  </div>
				  <div class="joinmember" >					
					<span>@Model.counts[item.GoodsSeq]<span style="color:#4a4a4a">참여중</span></span>
				  </div>
				  @if(item.RegDate.Value.AddDays(3) > DateTime.Now)
                    {
				  <div class="newicon"></div>
                    }
                </div>
              </li>	
                }
            </ul>
        </div>
        <div class="pagination pagination-small pagination-centered">
	      <ul id="page">
              <li><a href="/Goods/List/1">&lt&lt</a></li>
              <li><a href="/Goods/List/@(Model.pagePre)">&lt</a></li>
              @for (int i = Model.pageMin; i <= Model.pageMax; i++)
              {
                  <li class="@(Model.page == i ? "active" : "")"><a href="/Goods/List/@i">@i</a></li>
              }
              <li><a href="/Goods/List/@(Model.pageNext)">&gt</a></li>
              <li><a href="/Goods/List/@(Model.pageCount)">&gt&gt</a></li>
	      </ul>
	    </div>
	</div>		
</div>	
<script>
    (function () {
        $('.thumbnail').click(function () {
            document.location.href = $(this).attr("data-url");
        })
    })();
    
</script>